package psd.model.Prolog.Converters;

import org.eclipse.jdt.core.dom.SwitchStatement;

import psd.model.IConverter;
import psd.model.Prolog.FactGenerationToolbox;
import psd.model.Prolog.PrologConverter;


public class PrologSwitchStatementConverter extends PrologConverter implements
		IConverter<SwitchStatement> {

	public PrologSwitchStatementConverter(FactGenerationToolbox toolbox) {
		super(toolbox);
	}

	@Override
	public boolean convert(SwitchStatement node) {
		String args[] = { idResolver.getID(node.getExpression()),
				idResolver.getIDs(PrologCommon.expandList(node.statements().iterator())) };
		createBodyFact(node, "switchT", args);
		return true;
	}

}
